<template>
	<view>
		<nav-header title="套餐列表" :show-right="false">
		</nav-header>
		<view class="content" v-for="(item,index) in list" :key="index" @click="skipPurchase(item.id)">
			<view class="content-left">
				<image class="img" :src="item.packageImage"></image>
				<view class="fonst fl">{{item.packageName}}</view>
			</view>
			<view class="content-right">
				<view class="fonst">{{item.promotionPackageCount}}个</view>
				<view>￥<span class="price">{{item.agentFee}}</span></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		methods: {
			//跳转到购买页面
			skipPurchase(id) {
				uni.navigateTo({
					url: "/pageSubOne/mine/mine-setmenu-purchase?id=" + id
				})
			},
			getlist() {
				this.$http({
					url: "/package/list",
					method: "get"
				}).then((res) => {
					this.list = res
				})
			}
		},
		onLoad() {
			this.getlist()
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;
		display: flex;
		justify-content: space-between;
		margin-top: 10px;

		// margin-left: 10px;
		// margin: 10px;
		.fonst {
			// width: 90px;
			/* #ifndef MP-WEIXIN */
			font-size: 16px;
			/* #endif */
			color: black;
			font-weight: bold;
		}

		.content-left {
			width: 60%;
			display: flex;
			align-items: center;
			// justify-content: space-between;
			padding: 0 10px;

			//border: 1px solid red;
			.img {
				width: 120px;
				height: 120px;
			}
		}

		.content-right {
			width: 40%;
			display: flex;
			align-items: center;
			justify-content: space-evenly;

			// border: 1px solid red;
			.price {
				font-size: 14px;
				color: red;
			}
		}

		.fl {
			margin-left: 20px;
		}
	}
</style>